Skip to main content

Get a List of All Templates

The endpoint is used to get a list of video templates. This is a paginated endpoint and hence you will receive a paginated response.

Video templates only

Templates are only used by videos. Single images and carousels are made with Model Version 4, which does not use templates, so image, carousel, quotes and meme templates are no longer listed. Pass media_type as video: any other value, or leaving media_type out, gets HTTP status code 410 and the response below.

{
"templates": [],
"total_pages": 0,
"errors": [{
"field": "media_type",
"detail": "Templates are only available for media_type video. Single images and carousels are made with Model Version 4, which does not use templates.",
"solution": "Pass media_type as video to list video templates, or call create_content with model_version 4 without template_ids. See documentation: https://predis.ai/developers/"
}]
}

Request URL​

  • GET https://brain.predis.ai/predis_api/v1/get_templates/

Request Parameters​

NameDescriptionTypeDefault ValuePossible ValuesRequired
brand_idThe brand_id serves as the unique identifier for your brand. Using the brand_id, you will also have access to your custom templates on the first page.StringNoneYOUR_BRAND_IDYes
media_typeMedia type of the templates. Only video templates are available.StringNonevideoYes
post_typeTo obtain templates of a specific type of post.StringgenericgenericNo
aspect_ratioTo obtain templates of a specific aspect ratio.Stringallsquare, portrait, landscape, allNo
page_nIndicate the page number to retrieve templates from that particular page.Integer11, 2, 3...etcNo
items_nIndicate the desired number of templates for each page.Integer101, 2, 3...etcNo

Sample Success Response​

{
"templates": [{
"template_id": "...",
"media_type": "..."
}],
"total_pages": 50,
"errors": []
}

Sample Error Response​

{
"errors": [{
"detail": "...",
"solution": "..."
}]
}

Response Codes​

HTTP Status CodeError CodeUser MessageRecommended solution
429001Maximum number of requests reachedMaximum number of hourly requests reached You have been rate-limited. Wait for sometime and try again
400002Invalid brand_id providedYou have provided an invalid brand_id. Please provide a valid brand_id and try again. Read more here
400003Page numbers of Items number is invalidMake sure the value of page_n and items_n is integer
400004Provided aspect_ratio is not supportedMake sure the value of aspect_ratio field is supported. Please check the Request Parameters in the above table for more details
400006The provided value for the video_duration field is not validMake sure the value is either short or long
400007The provided value for the post_type field is not validMake sure the value is generic
410-Templates are only available for media_type videoPass media_type as video. Single images and carousels are made with Model Version 4 and need no templates

Rate Limiting​

Standard API rate limits apply to this endpoint. Read more about the rate limits here